package com.googlecode.lookie.platform.image;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;

import com.googlecode.lookie.platform.image.format.Formats;
import com.googlecode.lookie.platform.image.io.JdkReader;
import com.googlecode.lookie.platform.image.io.ReaderRegistry;

public class RegistryContributor
    implements InitializingBean
{

    @Autowired
    private ReaderRegistry readerRegistry;

    public void afterPropertiesSet()
    {

        readerRegistry.setReader( Formats.JPEG, new JdkReader( "JPEG" ) );
        readerRegistry.setReader( Formats.GIF, new JdkReader( "GIF" ) );
        readerRegistry.setReader( Formats.BMP, new JdkReader( "BMP" ) );
        readerRegistry.setReader( Formats.PNG, new JdkReader( "PNG" ) );
    }

}
